package com.ccjt.efcfs.enums;

/**
 * 分期间隔类型
 */
public enum IntervalTypeEnum implements IEnum<String, String> {
    MONTH("mon", "月"),
    DAY("day", "日"),
    ;
    private final String key;
    private final String desc;

    IntervalTypeEnum(String key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    public static IntervalTypeEnum getEnumByKey(String key) {
        return new EnumHelper<>(IntervalTypeEnum.class).valueOf(key);
    }

    public static IntervalTypeEnum getEnumByDesc(String desc) {
        IntervalTypeEnum enumTemp = EnumHelper.valueOfDesc(IntervalTypeEnum.class, desc);
        if (enumTemp == null) {
            return null;
        }
        return enumTemp;
    }

    public String getKey() {
        return key;
    }

    public String getDesc() {
        return desc;
    }

}
